﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace EdexApiClient
{
    public class UserRegisterDetails
    {
        public string Name { get; set; }
        public string Email { get; set; }
    }

    public class Invoices
    {
        public Guid GUID_RECORD { get; set; }

        public short VERSION { get; set; }
        public string DOC_ID { get; set; }
        public string DOC_NUMBER { get; set; }
        public DateTime DOC_DATE { get; set; }

        public Guid COMPANY_GUID { get; set; }
        public Guid CUSTOMER_GUID { get; set; }
        public Guid? LOCATION_GUID { get; set; }

        public short LINECOUNT { get; set; }
        public decimal TOTAL_AMOUNT { get; set; }
        public decimal TAX_AMOUNT { get; set; }
        public string NOTE { get; set; }

        public WH_COMPANIES COMPANY { get; set; }
        public WH_COMPANIES CUSTOMER { get; set; }
        public WH_LOCATIONS LOCATION { get; set; }

        public IEnumerable<InvoiceLines> LINES { get; set; }
    }

    public class InvoiceLines
    {
        public Guid GUID_RECORD { get; set; }

        public Guid INVOICE_GUID { get; set; }
        public Guid? ITEM_GUID { get; set; }
        public decimal PRICE { get; set; }
        public decimal QUANTITY { get; set; }
        public decimal TOTAL { get; set; }

        public WH_ITEMS ITEM { get; set; }
    }


    public class WH_COMPANIES
    {
        public Guid GUID_RECORD { get; set; }
        public string COMPANY_NAME { get; set; }
        public string EXT_KEY { get; set; }
        public string NOTE { get; set; }

        public Guid? OWNER_GUID { get; set; }
        public WH_COMPANIES OWNER { get; set; }

        public COMPANY_MAP MAP { get; set; }
    }

    public class SEC_COMPANIES_ACCESS
    {
        public Guid GUID_RECORD { get; set; }

        public Guid COMPANY_GUID { get; set; }
        public Guid ALLOW_TO_GUID { get; set; }
        public string SECURITY_CODE { get; set; }
        public bool IS_ALLOWED { get; set; }

        public WH_COMPANIES COMPANY { get; set; }
        public WH_COMPANIES ALLOW_COMPANY { get; set; }
    }

    public class WH_ITEMS
    {
        public Guid GUID_RECORD { get; set; }
        
        public Guid COMPANY_GUID { get; set; }
        public string ITEM_NAME { get; set; }
        public string EXT_KEY { get; set; }

        public WH_COMPANIES COMPANY { get; set; }
    }

    public class WH_LOCATIONS
    {
        public Guid GUID_RECORD { get; set; }
        
        public Guid COMPANY_GUID { get; set; }
        public string LOCATION_NAME { get; set; }
        public string EXT_KEY { get; set; }
        public string COUNTRY { get; set; }
        public string POSTAL_CODE { get; set; }
        public string CITY { get; set; }
        public string STREET { get; set; }
        public string BUILDING_NUMBER { get; set; }
        public string NOTE { get; set; }
        public bool IS_DEFAULT { get; set; }

        public WH_COMPANIES COMPANY { get; set; }
    }

    public class ITEM_COMPANY_MAP
    {
        public Guid COMPANY_GUID { get; set; }
        public string COMPANY_NAME { get; set; }
        public Guid ITEM_GUID { get; set; }
        public string ITEM_NAME { get; set; }
        public Guid? MAP_ITEM_GUID { get; set; }
        public string MAP_ITEM_NAME { get; set; }
    }


    public class SEC_USER_COMPANIES
    {
        public Guid GUID_RECORD { get; set; }

        public Guid USER_GUID { get; set; }
        public Guid ALLOW_TO_GUID { get; set; }
        public string SECURITY_CODE { get; set; }
        public bool IS_ALLOWED { get; set; }

        public WH_COMPANIES COMPANY { get; set; }
    }

    public class API_SESSION
    {
        public Guid USER_GUID { get; set; }
        public Guid COMPANY_GUID { get; set; }

        public string USERNAME { get; set; }
        public string EMAIL { get; set; }

        public string COMPANYNAME { get; set; }
        public string COMPANY_KEY { get; set; }

        public DateTime LOGON_DATETIME { get; set; }
        public string APIKEY { get; set; }
    }

    public class ITEM_MAP
    {
        public Guid LEFT_ITEM_GUID { get; set; }
        public Guid RIGHT_ITEM_GUID { get; set; }
    }

    public class LOCATION_MAP
    {
        public WH_LOCATIONS LEFT_LOCATION_MAP { get; set; }
        public WH_LOCATIONS RIGHT_LOCATION_MAP { get; set; }
    }

    public class COMPANY_MAP
    {
        public WH_COMPANIES LEFT_COMPANY_MAP { get; set; }
        public WH_COMPANIES RIGHT_COMPANY_MAP { get; set; }
    }


    public class WH_INVOICES
    {
        public Guid GUID_RECORD { get; set; }

        public short VERSION { get; set; }
        public Guid COMPANY_GUID { get; set; }
        public Guid? COMPANY_MAPPED_GUID { get; set; }
        public string DOC_ID { get; set; }
        public string DOC_NUMBER { get; set; }
        public DateTime DOC_DATE { get; set; }

        public Guid? CUSTOMER_GUID { get; set; }
        public Guid? CUSTOMER_MAPPED_GUID { get; set; }
        public Guid? LOCATION_GUID { get; set; }
        public Guid? LOCATION_MAPPED_GUID { get; set; }

        public string CUSTOMER_DOC_ID { get; set; }
        public short LINECOUNT { get; set; }
        public decimal TOTAL_AMOUNT { get; set; }
        public decimal TAX_AMOUNT { get; set; }
        public string NOTE { get; set; }

        public IEnumerable<WH_INVOICE_LINES> LINES { get; set; }

        public WH_COMPANIES COMPANY { get; set; }
        public WH_COMPANIES COMPANY_MAPPED { get; set; }

        public WH_COMPANIES CUSTOMER { get; set; }
        public WH_COMPANIES CUSTOMER_MAPPED { get; set; }

        public WH_LOCATIONS LOCATION { get; set; }
        public WH_LOCATIONS LOCATION_MAPPED { get; set; }
    }

    public class WH_INVOICE_LINES
    {
        public Guid GUID_RECORD { get; set; }

        public Guid INVOICE_GUID { get; set; }
        public Guid? ITEM_GUID { get; set; }
        public Guid? ITEM_MAPPED_GUID { get; set; }
        public decimal PRICE { get; set; }
        public decimal QUANTITY { get; set; }
        public double TOTAL { get; set; }

        public WH_ITEMS ITEM { get; set; }
        public WH_ITEMS ITEM_MAPPED { get; set; }
    }
}